<extend name="Public/content" />
<block name="style">
<style type="text/css">
    .table>tbody>tr>td{ padding: 4px; vertical-align: middle;}
     body{ background: #fff;}
    .footer {
    width: 100%;
    height: 50px;
    position: fixed;
    bottom: 0;
   
    left: 0;
    line-height: 50px;
    text-align: right;
    text-align: right;
    border-top: solid 1px #eee;
    padding-right: 10px;
    z-index: 999999999999999;
}
</style>
</block>
<block name="body">
    <form action="{:U('Nav/edit_nav_group_list')}" method="post" id="searchForm">
     <input type="hidden" name="parent_id" value="0" id="parent_id">
    <include file="Public:artdialog" />
    <div class="row">
        <div class="col-md-12">
            <div class="block-web">
                <div class="header">
                    <h3 class="content-header">权限组列表</h3>
                </div>

                <div class="porlets-content">
                    <div class="table-responsive">
                        <div id="order_list_item_content">
                            <div class="item-list-bd" style="height:100px;line-height:100px;text-align:center;">
                                <img src="__PUBLIC__/admin/images/load3.gif" />
                                加载中...
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
    <div class="footer" >
        <button class="btn btn-default bt_close" type="button" onclick="art.dialog.open.api.close();" >关闭</button>
    </div>
</block>
<block name="script">
<script type="text/javascript">
    $(function(){
        goSearch("#searchForm","order_list_item_content");
       $(document).keydown(function(event){ 
        if(event.keyCode==13){ 
        load(); 
        } 
            })
    });

    function load(){
        goSearch("#searchForm","order_list_item_content");
    }

    function toParentChilder(id){
        $('#parent_id').val(id);
        goSearch("#searchForm","order_list_item_content");
    }

    function delete_ok(id){  
        art.dialog({
            content: "是否确认删除?",
            icon: 'question',
            lock: true,
            opacity: 0.2,
            id:'dele',
            ok: function () {
                var url="{:U('Nav/delete_ok_group')}";
                $.ajax({
                    'url':url,
                    'data':{id:id},
                    'dataType':'json',
                    'type':'post',
                    success:function(data){

                        goSearch("#searchForm","order_list_item_content");

                        //_reload_currentpage_datalist('order_list_item_content');
                        // goSearch("#searchForm","order_list_item_content");
                        var retstatus = data.status == 1 ? "1" : "0";
                        showvfmsg(retstatus, data.info, 1900);

                    },error:function(){
                        showvfmsg('error','请求服务器失败',2000);
                    },complete:function(){

                    }
                });


            },
            cancelVal: '取消',
            cancel: true
        });
    }

    function return_up(){
        var url="{:U('Nav/return_up')}";
        $.post(url,{"parent_id":$("#parent_id").val()},function(resultObj){
               if(resultObj.status==1){
                   $("#parent_id").val(resultObj.info);
                   goSearch("#searchForm","order_list_item_content");
               }else{
                   showvfmsg('error',resultObj.info,2000);
               }
        });
    }

    function return_main(){
        $("#parent_id").val(0);
        goSearch("#searchForm","order_list_item_content");
    }

</script>
</block>